package com.itheima.bigevent.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.groups.Default;
import lombok.Data;

import java.time.LocalDateTime;

@Data
public class Category {
    /**
     * 主键ID
     */
    @NotNull(message = "id不能为空", groups = {Update.class, Delete.class})
    @Min(value = 1, message = "id必须大于0", groups = {Update.class, Delete.class})
    private Integer id;
    /**
     * 分类名称
     */
    @NotEmpty
    private String categoryName;
    /**
     * 分类别名
     */
    @NotEmpty
    private String categoryAlias;
    /**
     * 创建人ID
     */
    private Integer createUser;
    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    public interface Add extends Default{}

    public interface Update extends Default{}

    public interface Delete {}
}
